From 98545db1d290a55b5d6e233d07e9fca2a2fc5173 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 9 Oct 2013 10:56:58 -0700 Subject: [PATCH] * intervals.c (temp_set_point_both): Move test into 'eassert', for speed. --- src/ChangeLog | 3 +++ src/intervals.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index e6d9ce695aa..81204b4c44f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2013-10-09 Paul Eggert + * intervals.c (temp_set_point_both): Move test into 'eassert', + for speed. + * lisp.h (eassert): Don't use 'assume'. Sometimes 'assume' wins in performance, and sometimes it loses, so it shouldn't be used all the time. Perhaps we need two diff --git a/src/intervals.c b/src/intervals.c index 69a33867283..a9c4f5aed0b 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1792,8 +1792,7 @@ temp_set_point_both (struct buffer *buffer, ptrdiff_t charpos, ptrdiff_t bytepos) { /* In a single-byte buffer, the two positions must be equal. */ - if (BUF_ZV (buffer) == BUF_ZV_BYTE (buffer)) - eassert (charpos == bytepos); + eassert (BUF_ZV (buffer) != BUF_ZV_BYTE (buffer) || charpos == bytepos); eassert (charpos <= bytepos); eassert (charpos <= BUF_ZV (buffer) || BUF_BEGV (buffer) <= charpos); -- 2.30.2